<template>
    <div>
        <Form :label-width="130" inline>
            <Form-item label="姓名:">
                <Input v-model="queryParam.lpch0002" placeholder="" style="width:120px"/>
            </Form-item>
            <Form-item label="身份证号：">
                <Input v-model="queryParam.lpch0003" placeholder="" style="width:200px"/>
            </Form-item>
            <Row class="button_row">
              <span style="float: right;">
                 <Button type="primary" @click="searchQuery"> 查询</Button>
                <Button type="primary" class="button_item_left" @click="searchReset">重置</Button>
              </span>
            </Row>
        </Form>
        <div class="table_div">
            <Table :columns="columns1" :data="tableData">
                <template slot-scope="{ row }" slot="action">
                    <Button type="success"  size="small" style="margin-right: 5px" @click="showModal(row)">详情</Button>
                </template>
            </Table>
            <Page    :total="dataCount" :page-size="pageSize"  @on-change="handleTableChange" :current="pageNo" show-total class="paging"></Page>
        </div>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import DateFormat from '@/plugins/format.js'

    export default {
        mixins: [CommonMixin],
        data() {
            return {
                //批次号
                type: '',
                title:'',
                mode: true,
                statusLevel: '',
                disable: false,
                formItem: {
                    id: '',
                    interfaceName: '',
                    interfaceUrl: '',
                    interfaceType: '',
                    appKey: '',
                    onOff: '',
                },
                modalShow: false,
                ss00011ModelShow: false,
                // 初始化信息总条数
                dataCount:0,
                // 每页显示多少条
                pageSize:10,
                queryParam: {},
                url: {
                    list: "/api/ac/subsistence/ss00023Service/getPageList",
                },
                columns1: [
                    {
                        title: '申请救助业务类别',
                        key: 'LPCH0001',
                        align: 'center',
                    },
                    {
                        title: '申请人姓名',
                        align: 'center',
                        key: 'LPCH0002'
                    },
                    {
                        title: '申请人身份证号码',
                        align: 'center',
                        key: 'LPCH0003'
                    },
                    {
                        title: '数据来源',
                        align: 'center',
                        key: 'LPCH0004',
                        render: (h, params) => {
                            let value = params.row.LPCH0004
                            if (typeof (value) === 'undefined' || value === null || value === '' || value === undefined) {
                                value = ''
                            }else if (value === '1000'){
                                value = "企业机构"
                            }else if (value === '700'){
                                value = "个体工商"
                            }else if (value === '600'){
                                value = "社会组织"
                            }
                            return h('span', value + ' ')
                        }
                    },
                    {
                        title: '企业名称/经营状态',
                        align: 'center',
                        key: 'LPCH0005',
                        width: 300
                    },{
                        title: '注册资金(万元)',
                        align: 'center',
                        key: 'LPCH0006',
                        width: 100
                    },{
                        title: '查验时间',
                        align: 'center',
                        key: 'LPCH0007',
                        render: (h, params) => {
                            let value = params.row.LPCH0007
                            if (typeof (value) === 'undefined' || value === null || value === '' || value === undefined) {
                                value = '--'
                            }else{
                                value = DateFormat( value, 'YYYY-MM-DD hh:mm:ss')
                            }
                            return h('span', value + ' ')
                        }
                    },
                    {
                        title: '所属区划',
                        align: 'center',
                        key: 'azaa0002',
                    },
                    {
                        title: '操作人',
                        align: 'center',
                        key: 'LPCH0009',
                        width: '120',
                    }
                ],
                data: []
            }
        },
        methods: {
            //获取数据
            changePage(pageNo){
                //页面翻页事件
                this.data = this.loadData(pageNo);
            }
        },
        created () {
            // 默认请求第一页列表
            this.loadData();
        }

    }
</script>

<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }
</style>
